package pay

import (
	rotatelogs "github.com/lestrrat-go/file-rotatelogs"
	"io"
	"log"
	"os"
	"strings"
)

/**
 * @className log
 * @author liyang<654516092@qq.com>
 * @date 2021/1/22 11:43
 */

type PaymentLog struct {
	loggers *log.Logger
}

func (p *PaymentLog) GetInstance(filePath string)(*PaymentLog){
	file, _ := rotatelogs.New(filePath)
	p.loggers = log.New(io.MultiWriter(file, os.Stderr),
		strings.ToUpper("INFO")+"：",
		log.Ldate|log.Ltime|log.Lshortfile)
	return p
}

func (p *PaymentLog) Printf(format string,v ...interface{}){
	p.loggers.Printf(format,v)
}




